﻿using System;

namespace MyNetflix2
{
    [Serializable()]
    public class AccessToken
    {
        #region Locals

        private string _Token;
        private string _TokenSecret;
        private string _UserId;

        #endregion

        #region Properites

        public string UserId
        {
            get { return _UserId; }
        }
        public string Token
        {
            get { return _Token; }
        }
        public string TokenSecret
        {
            get { return _TokenSecret; }
        }

        #endregion

        #region Constructor

        /// <summary>
        /// Constructor
        /// </summary>
        public AccessToken()
        {}


        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="data"></param>
        public AccessToken(string data)
        {
            ClrExtensions.Net.Rest.QueryParameterCollection parsedData = new ClrExtensions.Net.Rest.QueryParameterCollection(data);
            _UserId = parsedData["user_id"];
            _Token = parsedData["oauth_token"];
            _TokenSecret = parsedData["oauth_token_secret"];
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="token"></param>
        /// <param name="tokenSecret"></param>
        public AccessToken(string userId, string token, string tokenSecret)
        {
            _UserId = userId;
            _Token = token;
            _TokenSecret = tokenSecret;
        }

        #endregion
    }
}
